#!/usr/bin/env python
# -*- encoding: utf-8 -*-
"""
@File        :   242.有效的字母异位词.py    
@Contact     :   lhouctcs@163.com
@License     :   MIT
@Time        :   2023/2/6 12:03
@Author      :   lhou 
@Version     :   0.1.0
@Description :
"""


# import lib
class Solution:
    def isAnagram(self, s: str, t: str) -> bool:
        dic_s = dict()
        dic_t = dict()
        for i in s:
            if i in dic_s:
                dic_s[i] += 1
            else:
                dic_s[i] = 1

        for i in t:
            if i in dic_t:
                dic_t[i] += 1
            else:
                dic_t[i] = 1

        return dic_s == dic_t
